//package homework.day17;
//
//import java.io.BufferedReader;
//import java.io.FileNotFoundException;
//import java.io.FileReader;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.List;
//
//public class EmployyeeImpl implements IEmployeeDao {
//
//        private static String path = "Employee.txt";
//        List<Employee> list = new ArrayList<>();
//        {
//            list = findAll();
//        }
//    @Override
//    public void save(Employee employee) {
//        for (Employee e : list) {
//            if (e.getEmpId().equals(employee.getEmpId())){
//                System.out.println("ID已存在");
//                return;
//            }
//        }
//        list.add(employee);
//        write();
//    }
//
//    @Override
//    public List<Employee> findAll() {
//        BufferedReader br = null;
//        List<Employee> employees = new ArrayList<>();
//        try {
//            br = new BufferedReader(new FileReader(path));
//            while (true){
//                String line = br.readLine();
//                if (line == null||line == "")
//                    break;
//                Employee e = read(line);
//                employees.add(e);
//            }
//        } catch (FileNotFoundException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
//        return employees;
//    }
//}
